import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../layout/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    redirect: 'goods',
    children: [
      {
        path: '/goods',
        name: 'goods',
        component: () =>
          import(/* webpackChunkName: "about" */ '../views/goods')
      },
      {
        path: '/rates',
        name: 'rates',
        component: () => import(/* webpackChunkName: "about" */ '../views/rate')
      },
      {
        path: '/shop',
        name: 'shop',
        component: () => import(/* webpackChunkName: "about" */ '../views/shop')
      }
    ]
    // 我是下面的子路由的区域
  }
]
//  component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
const router = new VueRouter({
  routes
})

export default router
